package net.zjitc.service;

import net.zjitc.common.ServiceResponse;
import net.zjitc.pojo.User;

/**
 * @author 赵静静
 * @date 2019/3/22 12:08
 */
public interface UserService {
    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    ServiceResponse<User> login(String username, String password);

    ServiceResponse<String> register(User user);

    ServiceResponse<String> checkValid(String str,String type);

    /**
     * 根据用户名获取问题
     * @param username
     * @return
     */
    ServiceResponse<String> selectQuestion(String username);

    /**
     * 验证问题的答案
     * @param username
     * @param question
     * @param answer
     * @return
     */
    ServiceResponse<String> checkAnswer(String username,String question,String answer);

    ServiceResponse<String> forgetRestPassword(String username, String newPassword, String forgetToken);

    ServiceResponse<String> resetPassword(String oldPassword, String newPassword, User user);
}
